package com.orange.base.component.biztool.simulateddata.service.impl;

import java.util.UUID;

import com.orange.base.component.biztool.simulateddata.service.SimulatedDataEnum;
import com.orange.base.component.biztool.simulateddata.service.SimulatedDataParam;

/**
 * UUID
 *
 * @author biankudingcha
 * @date: 2022-08-24
 * @since 0.5.0
 */
public class UUIDStrategy extends AbstractSimulatedData {

    public String getType() {
        return SimulatedDataEnum.UUID.getName();
    }

    public String getCaption() {
        return SimulatedDataEnum.UUID.getCaption();
    }

    @Override
    public Object getValue(SimulatedDataParam param) {
        return "sd__6_" + simpleUUID();
    }

    private String simpleUUID() {
        String uuid = UUID.randomUUID().toString(); // 获取UUID并转化为String对象
        uuid = uuid.replace("-", "");
        return uuid;
    }

}
